<?php
$str = '<div class="go_num">';

if ($this->curPage>1){
	$this->params[$this->varName] = $this->curPage-1;
	$str .= '<a class="dn" href="' . U(YYK::$ctrlName, YYK::$methodName, $this->params) . '">上一页</a>';
}

if ($this->curPage>1){
	$this->params[$this->varName] = 1;
	$str .= '<a href="' . U(YYK::$ctrlName, YYK::$methodName, $this->params) . '">1</a>';
}
else{
	$str .= '<a class="h">1</a>';
}

if ($this->curPage>4) {
	$str .= '<a class="mh">...</a>';
}

$from = ($this->curPage-2)>1 ? $this->curPage-2 : 2;
$to = ($this->curPage+2)<$this->pageCount ? $this->curPage+2 : $this->pageCount-1;

for ($i=$from; $i <= $to; $i++) { 
	if ($i==$this->curPage) {
		$str .= '<a class="h">'. $i .'</a>';
	}
	else{
		$this->params[$this->varName] = $i;
		$str .= '<a href="' . U(YYK::$ctrlName, YYK::$methodName, $this->params) . '">'. $i .'</a>';
	}
}

if ($this->curPage<$this->pageCount-3) {
	$str .= '<a class="mh">...</a>';
}

if ($this->curPage < $this->pageCount) {
	$this->params[$this->varName] = $this->pageCount;
	$str .= '<a href="' . U(YYK::$ctrlName, YYK::$methodName, $this->params) . '">'. $this->pageCount .'</a>';
}
else{
	$str .= '<a class="h">'. $this->pageCount .'</a>';
}
if ($this->curPage < $this->pageCount) {
	$this->params[$this->varName] = $this->curPage+1;
	$str .= '<a class="dn" href="' . U(YYK::$ctrlName, YYK::$methodName, $this->params) . '">下一页</a>';
}

$str .= <<<EOT
	到第 <input name="" type="text" class="go_num_t"> 页
    <input name="" type="button" class="btn_a goPage" value="确定">
</div>
EOT;

//echo $str;
return $str;